using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class EyeTreatMap : EntityTypeConfiguration<EyeTreat>
    {
        public EyeTreatMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.PatID)
                .IsFixedLength()
                .HasMaxLength(30);

            this.Property(t => t.Date)
                .IsFixedLength()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("EyeTreat");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.PatID).HasColumnName("PatID");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Complaint).HasColumnName("Complaint");
            this.Property(t => t.Findings).HasColumnName("Findings");
            this.Property(t => t.Initial).HasColumnName("Initial");
            this.Property(t => t.Treatment).HasColumnName("Treatment");
        }
    }
}
